package tools;

public class Converter {

	public static double dBm2W(double dBm){
		return Math.pow(10, dBm/10)*Math.pow(10, -3);
	}
	
	public static double W2dBm(double W){
		return Math.log10(W*Math.pow(10, 3))*10;
	}
	
	public static int log2ceil(double d) {
	    return (int)Math.ceil(Math.log(d)/Math.log(2.0));
	}
}
